// 解构嵌套的结构体和枚举
enum Message {
    Quite,
    Move { x: i32, y: i32 },
    Write(String),
    ChangeColor(Color),
}
enum Color {
    RGB(i32, i32, i32),
    HSV(i32, i32, i32),

}
fn main() {
    // 枚举解构，创建message
    let msg = Message::ChangeColor(Color::HSV(0, 160, 255));
    match msg {
        Message::Quite => {
            println!("Quite");
        },
        Message::Move { x, y } => {
            println!("Move X: {}, Y: {}", x, y);
        },
        Message::Write(text) => {
            println!("Write: {}", text);
        },
        Message::ChangeColor(Color::RGB(r, g, b)) => {
            println!("RGB Color: R: {}, G: {}, B: {}", r, g, b);
        },
        Message::ChangeColor(Color::HSV(r, g, b)) => {
            println!("HSV Color: R: {}, G: {}, B: {}", r, g, b);
        },

    };
}